/* Currently not used JavaScripts. */

function soStrToDate(InStr, Style) {
    MSECS_PER_DAY = 24*60*60*1000;
    re = /[^0-9]/;
    elems = InStr.split(re);

    switch (Style) {
        case "u" :
            month = elems[0]; day = elems[1]; year = elems[2];
            break;
        case "j" :
            year = elems[0]; month = elems[1]; day = elems[2];
            break;
        default: /* European */
            day = elems[0]; month = elems[1]; year = elems[2];

            now = new Date()
            if (elems.length < 2) month = now.getMonth()+1;
            if (elems.length < 3) year = 1900 + now.getYear();
    };

    result = Math.floor(Date.UTC(year, month-1, day) / MSECS_PER_DAY) +1;

    return result;
} // soStrToDate


function soStrToTime(InStr) {
    SECS_PER_DAY = 24*60*60;
    re = /[^0-9]/;
    elems = InStr.split(re);

    hour = elems[0]*1;

    if (elems.length > 1) minute = elems[1]*1;
    else minute = 0;

    if (elems.length > 2) second = elems[2]*1;
    else second = 0;

    half = InStr.substring(InStr.length-2, InStr.length);
    if (half.toUpperCase() == "PM") {
        hour += 12;
    };

    result = (hour*3600 + minute*60 + second) / SECS_PER_DAY;

    return result;
}; // soStrToTime
